package com.action.gulimall.product.controller;

import com.action.common.utils.R;
import com.action.gulimall.product.fegin.CoupenFeginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName TestController
 * @Deacription TODO
 * @Author sl
 * @Date 2021/6/10/010 15:36
 * @Version 1.0
 **/
@RefreshScope
@RestController
@RequestMapping("test")
public class TestController {

    @Autowired
    CoupenFeginService coupenFeginService;

    //测试nacos config
    @Value("${test}")
    String test;

    @RequestMapping("test/nacos/config")
    public R testNacosConfig(){
        return R.ok("测试结果：").put("test", test);
    }

    @RequestMapping("/fegin")
    public R testOpenFegin(String str){
        return coupenFeginService.testOpenFegin(str);
    }
}
